package apiday02;

public class RegDemo06 {
    public static void main(String[] args) {
        /**
         * 测试正则
         */
        String reg = "Hello[123456]";
        //String reg = "Hello[1-6]";
        //被测试字符串
        String s1 = "Hello1";
        String s2 = "Hello7";
        //测试
        System.out.println(s1.matches(reg));
        System.out.println(s2.matches(reg));

        String reg1 = "我[草去操艹]";
        String s3 = "我草";
        System.out.println(s3.matches(reg1));

        String reg2 = "[草去]你妈的";
        String s4 = "草你妈的";
        System.out.println(s4.matches(reg2));


    }
}
